//
//  MASExampleFlexView.m
//  MasonryExample
//
//  Created by 山刘 on 2020/6/11.
//  Copyright © 2020 山刘. All rights reserved.
//

#import "MASExampleFlexView.h"

@implementation MASExampleFlexView

+ (BOOL)requiresConstraintBasedLayout {
    return YES;
}
- (id)init {
    self = [super init];
    if (!self) return nil;
    
    UIView *v1 = [LayoutUtils createView];
    [self addSubview:v1];
    [v1 makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self);
        make.width.equalTo(self).multipliedBy(0.75);
    }];
    
    UIView *v2 = [LayoutUtils createView];
    [self addSubview:v2];
    [v2 makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.bottom.equalTo(self);
        make.left.equalTo(v1.mas_right);
    }];
    
    return self;
}

@end
